package main

import (
	//"fmt"

	"github.com/astaxie/beego"
	"github.com/astaxie/beego/orm"

	//"coinsend/models"
	_ "coinsend/routers"

	_ "github.com/go-sql-driver/mysql"
)

func init() {

	orm.RegisterDriver("mysql", orm.DRMySQL)
	mysqluser := beego.AppConfig.String("mysqluser")
	mysqlurl := beego.AppConfig.String("mysqlurls")
	mysqlport := beego.AppConfig.String("mysqlport")
	mysqlpass := beego.AppConfig.String("mysqlpass")
	mysqldb := beego.AppConfig.String("mysqldb")
	orm.RegisterDataBase("default", "mysql", mysqluser+":"+mysqlpass+"@tcp("+mysqlurl+":"+mysqlport+")/"+mysqldb+"?charset=utf8")
	orm.RunSyncdb("default", false, false)

	beego.SetLogger("file", `{"filename":"log/log.log","maxdays":90}`)

}

func main() {
	beego.Run()

}
